<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"> 
<h:head>
<link href="/css/sri.css" rel="stylesheet" type="text/css"/>
	
</h:head>
<ui:composition>
<body>
<h:form>
 <rich:popupPanel id="confirmation" width="250" height="150">
   <f:facet name="header">Confirmation</f:facet>
   <h:panelGrid>
      <h:panelGrid columns="2">
         <h:graphicImage value="/alert.png" />
	 <h:outputText value="Are you sure?" style="FONT-SIZE: large;" />
      </h:panelGrid>
      <h:panelGroup>
         <input type="button" value="OK"
	  onclick="#{rich:component('confirmation')}.hide();submit();return false" />
	 <input type="button" value="Cancel"
	  onclick="#{rich:component('confirmation')}.hide();return false" />
      </h:panelGroup>
   </h:panelGrid>
</rich:popupPanel>
 
  <h:panelGrid columns="5">
	  <rich:toolbar  height="34" itemSeparator="line"   >
		  <rich:toolbarGroup>
		  		 		<h:commandLink action="#{catalogoController.nuevoCatalogo()}">
		  		 	 	 	<h:panelGrid columns = "2">
			  		 	 	 	<h:graphicImage id="new" value="/img/Nuevo.png"  />
			  		 	 	   <h:outputLabel value="Nuevo" />
			  		 	 	</h:panelGrid>
			            
			              
			              <f:param name="idCatalogo" value="0" />
		          		</h:commandLink>
		
		           
		          	</rich:toolbarGroup >
		  <rich:toolbarGroup location="right" > 
		                <h:inputText styleClass="barsearch"  />
		                <h:commandButton styleClass="barsearchbutton" onclick="return false;"  value="Buscar" />
		            </rich:toolbarGroup>
	  </rich:toolbar>
	  <h:outputLabel value="Usuario: #{catalogoController.usuario.nombresapellidos}" style="margin-left: 10px;margin-right: 10px;"/>
	  <h:commandLink action="#{catalogoController.direccionar() }" style="margin-left: 10px;margin-right: 10px;">
	  	 	<h:graphicImage value="/img/Inicio.png" alt="Inicio"></h:graphicImage>
	  	 	<f:param name="pagina" value="menu" />
	 </h:commandLink>
	  	  
	 <h:graphicImage value="/img/logoMinisterio.png" style="align-left"></h:graphicImage>
  	 
  	
  </h:panelGrid>
  <h:outputLabel value="#{catalogoController.titulo}" style="color:#0F6CB6; font-size:20px;"  />
  <rich:dataTable id="tblCatalgo" value="#{catalogoController.catalogos}" var="item" rows="20" >
		
		<rich:column style="text-align:center;" >
			<f:facet name="header">
				<h:outputText value="Editar" />
			</f:facet>

			<h:commandLink action="#{catalogoController.editarCatalogo()}">
	        <h:graphicImage value="/img/Editar.png" alt="Editar #{catalogoController.titulo}" style="border:0;" >
			
	        </h:graphicImage>
	        	<f:param name="fila" value="#{item.id}" />
	        
	    </h:commandLink>
	    
		</rich:column>
		
		<rich:column style="text-align:center;" >
			<f:facet name="header">
				<h:outputText value="Eliminar" />
			</f:facet>
				 <h:commandLink  action="#{catalogoController.eliminarCatalogo()}" onclick="if (! confirm('Está serguro de eliminar el registro seleccionado?') ) { return false;}; return true; "  >
					<h:graphicImage url="/img/delete.png" style="border:0;"
									alt="Eliminar" />
									
						<f:param name="fila" value="#{item.id}" />
				</h:commandLink>		
		</rich:column>
		<rich:column style="text-align:center;" sortBy="#{item.id}">
			<f:facet name="header">
				<h:outputText value="Código" />
			</f:facet>
			<h:outputText value="#{item.codigonegocio}" />
		</rich:column>
		<rich:column style="text-align:center;" sortBy="#{item.descripcion}">
			<f:facet name="header">
				<h:outputText value="Descripción" />
			</f:facet>
			<h:outputText value="#{item.descripcion}" />
		</rich:column>
	
	</rich:dataTable>

</h:form>
</body> 
</ui:composition>
</html>
